package com.hhxy;

import com.hhxy.entity.Item;
import com.hhxy.service.ItemService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-dao.xml","classpath:applicationContext-service.xml"})
public class ItemTesst {

    @Autowired
    private ItemService itemService;

    @Test
    public void qeuryAllItem(){
        List<Item> items = itemService.qeuryAllItem();
        for (Item item : items) {
            System.out.println(item);
        }
    }
}